﻿<%@ Page Title="" Language="C#" MasterPageFile="~/SkillifyMaster.master" AutoEventWireup="true" CodeFile="MyAssignments.aspx.cs" Inherits="MyAssignments" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <style type="text/css">
        .style2
        {
            width: 200px;
        }
        .style3
        {
            width: 205px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table width="100%">
        <tr>    
            <td align="right">
            <h2><asp:Label ID="lablMyAss" runat="server" Text="My Assignment"></asp:Label></h2>
            </td>
        </tr>

        <tr>    
            <td>
                <table align="left" cellspacing="5" style="border: 4px outset orange;" width="100%">
                   <tr>
                        <td>
                            <table width="100%">
                                <tr>
                                     <td height="30px" class="style2">
                                          <asp:LinkButton ID="lnkTestScheduled" runat="server" onclick="lnkTestScheduled_Click">
                                          <b>Assignment Scheduled</b></asp:LinkButton>(<b><asp:Label ID="lablScheduledCount" runat="server"
                                              Text=""></asp:Label></b>)

                                        </td>
  
                                        <td width="20px">|</td>
  
                                         <td class="style3">
                                            <asp:LinkButton ID="lnkTestPending" runat="server" 
                                              onclick="lnkTestPending_Click" ><b>Assignment Pending</b></asp:LinkButton>(<b><asp:Label ID="lablPendingCount" runat="server"
                                              Text=""></asp:Label></b>)

                                            </td>

                                        <td width="20px">|</td>
  
                                     <td>
                                         <asp:LinkButton ID="lnkTestCompteted" runat="server" 
                                          onclick="lnkTestCompteted_Click" ><b>Assignment Completed</b></asp:LinkButton>(<b><asp:Label ID="lablCompletedCount" runat="server"
                                              Text=""></asp:Label></b>)

                                      </td>


                                    </tr>
                            </table>
                        </td>
                    </tr> 

                   <td>
                                <asp:Label ID="lablSubj" runat="server" Text="Subject"></asp:Label> &nbsp;&nbsp;
                                 <asp:DropDownList ID="ddlSub" runat="server" AutoPostBack="True" 
                                    Width="220px" OnSelectedIndexChanged="ddlSub_SelectedIndexChanged">
                                </asp:DropDownList>

                                &nbsp;
                                <asp:CompareValidator ID="compSub" runat="server" ControlToValidate="ddlSub" 
                                    ErrorMessage="Please Select One subject" ForeColor="Red" Operator="NotEqual" 
                                    ValueToCompare="--Select One--">*</asp:CompareValidator>

                                &nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Label ID="lablTopics" runat="server" Text="Topic"></asp:Label>&nbsp;&nbsp;
                                <asp:DropDownList ID="ddlTopic" runat="server" Width="220px">
                                </asp:DropDownList>
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                 <asp:Button ID="btnShow" runat="server" Text="Show Assignments" 
                                onclick="btnShow_Click" BackColor="#E49642" 
                                BorderColor="#CC7A24" ForeColor="White" />
                                &nbsp;&nbsp;&nbsp;&nbsp;
                                 <asp:Button ID="ClearRecord" runat="server" Text="Clear search" 
                                CausesValidation="False" BackColor="#E49642" 
                                BorderColor="#CC7A24" ForeColor="White" onclick="ClearRecord_Click" />
                        </td>

                   <tr>
                        
                        <td>
                                <asp:Label ID="lablError" runat="server" ForeColor="Red"></asp:Label>
                                <asp:ValidationSummary ID="valSummSub" runat="server" ForeColor="Red" />
                        </td>
                       
                    </tr>
                </table>
            </td>
        </tr>

        <tr>    
            <td>
                <table align="left" width="100%">
                    <tr>
                        <td align="left" valign="top">
                            <asp:GridView ID="gvAssignment" runat="server" AllowPaging="True" 
                                AutoGenerateColumns="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" 
                                BorderWidth="1px" CellPadding="2" DataKeyNames="AssignmentId,States" 
                                ForeColor="Black" GridLines="Vertical" 
                                onpageindexchanging="gvAssignment_PageIndexChanging" 
                                Width="930px" onrowcommand="gvAssignment_RowCommand">
                                <AlternatingRowStyle BackColor="PaleGoldenrod" />
                                <Columns>
                                    <asp:ButtonField ButtonType="Link" CommandName="Select" 
                                        DataTextField="AssignmentId" HeaderText="Id" ItemStyle-Font-Underline="true" 
                                        SortExpression="AssignmentId">
                                    <ItemStyle Font-Underline="True" />
                                    </asp:ButtonField>
                                    <asp:BoundField DataField="AssignmentName" HeaderText="Name" 
                                        SortExpression="AssignmentName" />
                                    <asp:BoundField DataField="SubjectName" HeaderText="Subject" 
                                        SortExpression="SubjectName" />
                                    <asp:BoundField DataField="TopicName" HeaderText="Topic" 
                                        SortExpression="TopicName" />
                                    <asp:BoundField DataField="StartDate" HeaderText="StartDate" 
                                        SortExpression="StartDate" />
                                    <asp:BoundField DataField="EndDate" HeaderText="EndDate" 
                                        SortExpression="EndDate" />
                                    <asp:BoundField DataField="States" HeaderText="Status" 
                                        SortExpression="Status" />
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            <asp:Label ID="lablAction" runat="server" Text="Action"></asp:Label>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:LinkButton ID="btnLink" runat="server" Font-Underline="true" CommandName="btnLinkClick" CommandArgument='<%# Eval("AssignmentId") %>'>Manage</asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField>
                                        <HeaderTemplate>
                                            <asp:Label ID="lablRank" runat="server" Text="Rank"></asp:Label>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <asp:LinkButton ID="linkRank" runat="server" Font-Underline="true" CommandName="btnLinkRankClick" CommandArgument='<%# Eval("AssignmentId") %>'>Rank</asp:LinkButton>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                  
                                   
                                </Columns>
                                <EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <EmptyDataRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <FooterStyle BackColor="Tan" />
                                <HeaderStyle BackColor="#CB6811" Font-Bold="True" ForeColor="White" 
                                    HorizontalAlign="Center" />
                                <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" 
                                    HorizontalAlign="Center" />
                                <RowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                <SelectedRowStyle BackColor="#E49642" ForeColor="GhostWhite" />
                                <SortedAscendingCellStyle BackColor="#FAFAE7" />
                                <SortedAscendingHeaderStyle BackColor="#DAC09E" />
                                <SortedDescendingCellStyle BackColor="#E1DB9C" />
                                <SortedDescendingHeaderStyle BackColor="#C2A47B" />
                            </asp:GridView>
                        </td>
                    </tr>
            </table>
            </td>
        </tr>
    </table>
</asp:Content>

